package com.ziven.common.widget.value;

import android.view.View;

import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.NonNull;

import com.ziven.easygo.util.ResourceUtils;
import com.ziven.easygo.util.ViewHelper;

/**
 * @author Ziven
 */
public final class SubTitleColor extends Value {

    public static SubTitleColor colorId(@ColorRes int colorId) {
        return color(ResourceUtils.getColor(colorId));
    }

    public static SubTitleColor color(@ColorInt int color) {
        return new SubTitleColor().accept(my -> my.value = color);
    }

    private SubTitleColor() {}

    @Override
    protected void takeEffect(@NonNull ViewHelper<? extends View> helper) {
        value(Integer.class, helper::setSubtitleTextColor);
    }
}
